import { request } from '@/utils/request'

// 查询车辆订单列表
export function listCarOrder(query) {
  return request({
    url: '/system/carOrder/list',
    method: 'get',
    params: query
  })
}

// 续租
export function continueRent(data) {
  return request({
    url: '/system/carOrder/continueRent',
    method: 'put',
    data: data
  })
}

// 查询车辆订单列表
export function listNeedRentCarOrder() {
  return request({
    url: '/system/carOrder/needRentOrderList',
    method: 'get',
  })
}

// 查询车辆订单详细
export function getCarOrder(id) {
  return request({
    url: '/system/carOrder/' + id,
    method: 'get'
  })
}

// 新增车辆订单
export function addCarOrder(data) {
  return request({
    url: '/system/carOrder',
    method: 'post',
    data: data
  })
}

// 还车
export function returnCar(data) {
  return request({
    url: '/system/carOrder/returnCar',
    method: 'put',
    data: data
  })
}

// 取消订单
export function cancelCar(data) {
  return request({
    url: '/system/carOrder/cancelCar',
    method: 'put',
    data: data
  })
}

// 修改车辆订单
export function updateCarOrder(data) {
  return request({
    url: '/system/carOrder',
    method: 'put',
    data: data
  })
}

// 删除车辆订单
export function delCarOrder(id) {
  return request({
    url: '/system/carOrder/' + id,
    method: 'delete'
  })
}
